<template>
  <div>
    <el-input
      @clear="onClear"
      @input="onInput"
      v-bind="$attrs"
    >
      <template #append>
        <slot name="append"></slot>
      </template>
    </el-input>
  </div>
</template>

<script>
export default {
  methods: {
    onInput(e) {
      const reg = new RegExp(
        "and|exec|execute|insert|select|update|count|chr|mid|master|\\bchar\\b|declare|sitename|net user|xp_cmdshell|or|create|drop|table|from|grant|use|group_concat|column_name|information_schema.columns|table_schema|union|where|orderhaving|having|by|\\*|truncate|like",
        "i"
      );
      e = e.replace(reg, "");
      this.$emit("input", e);
    },
    onClear() {
      this.$emit("clear");
    },
  },
};
</script>

<style></style>
